library(shiny)

# Define UI for application that plots random distributions
shinyUI(fluidPage(
    fluidRow(
        column(3,
               h4('AEDE'),
               br(),hr(),br(),
               
                   radioButtons("std", label=h6("Estandarizar por:"),
                                c("Media"="mean", "Mediana"="median","No estandarizar"=""),
                                selected='median'),                     
                   checkboxInput('log',label='Transformación logarítmica',value=FALSE),
                   br(),
                   selectInput("data", label=h6("Consumo:"),
                               c("Total" = 'totec',
                                 "Per Cápita" = 'pc'),
                               selected='pc'),
                   selectInput("var", label=h6("Variable:"),
                               c("TOTURB","TOTRURL","RESURB","RESRURL","COMERURB","COMERRURL", 
                                 "INDUSURB","INDUSRURL","OURB","ORURL"),
                               selected='TOTURB',multiple=TRUE),
                   sliderInput("year", label = HTML('<h6>A&#241o:</h6>'),
                               min=1996,max=2012, value=2011,step = 1,animate=TRUE)
               
        ),
        column(9,
        tabsetPanel(
            tabPanel(h5('LISA cluster map'),
                fluidRow(
                    column(10,offset=1,
                           conditionalPanel("input.year != 1998",
                             plotOutput("plot1", width="445px",height = "500px")
                                    )
                                )
                    ),                
                fluidRow(                    
                    column(3,offset=1,
                           radioButtons("signif", label=h6("Umbral de Significancia:"),
                                        c("1%" = 0.01,
                                          "5%" = 0.05,
                                          "10%"=0.1),selected=0.05)
                               
                           ),
                    column(3,
                           sliderInput("hdist", label = h6("Vecindario (<= x horas)"),
                                           min=0.5,max=4, value=1,step = 0.5,animate=TRUE)                               
                               
                           ),
                    column(4,                          

                           numericInput('perm',label=h6('Numero de Permutaciones:'),
                                        value=1000,min=999,max=10000,step=100)
                                                      
                    )                                  
                )
                ),
                
             tabPanel(h5('Choropleth map'),

                      fluidRow(
                          column(10,offset=1,
                            conditionalPanel("input.year != 1998",
                             plotOutput("plot2", width="445px",height = "500px")
                            )
                          )                          
                        ),                      
                      fluidRow(
                          column(5,offset=1,
                                 
                                 selectInput("style", label=h6("Clasificar por:"),
                                             list('Cuantiles'='quantile',
                                                  'Quiebres Naturales'='jenks'),
                                             selected='quantile', selectize=FALSE)
                                 
                          ),
                          column(5,
                                 
                                 numericInput('int',label=h6('Numero de Intervalos'),value=5,
                                              min=3,max=10,step=1)
                                 
                          )
                      )
                   )
        )
      )      
    )
    
    
    
    
))